﻿<%@ Page Title="Refund Rules" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RefundRules.aspx.cs" Inherits="IFD2.RefundRules" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Status: " meta:resourcekey="Status"></asp:Label>
                <asp:DropDownList ID="lstStatus" runat="server" CssClass="form-control input-sm" Width="100%">
                    <asp:ListItem Value="E" meta:resourcekey="Editing">Editing</asp:ListItem>
                    <asp:ListItem Value="A" meta:resourcekey="Approved" Selected="True">Approved</asp:ListItem>
                    <asp:ListItem Value="D" meta:resourcekey="Deactivated">Deactivated</asp:ListItem>
                </asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="grdRules" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" 
                            DataKeyNames="airline,rule_code" DataSourceID="sqlRules" style="min-width:600px;width:100%;" class="table-hover">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                    <input name="KEY" type="radio" value='<%# Eval("rule_code") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="rule_code" HeaderText="rule_code" ReadOnly="True" 
                                    SortExpression="rule_code"  meta:resourcekey="rule_code" />
                                <asp:BoundField DataField="done_user" HeaderText="done_user" 
                                    SortExpression="done_user"  meta:resourcekey="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" 
                                    SortExpression="done_time"  meta:resourcekey="done_time" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </div>
                    <div class="btn-group">
                        <asp:Button ID="btnItems" runat="server" onclick="btnItems_Click" Text="Items..." CssClass="btn btn-sm btn-default"  meta:resourcekey="Items" />
                        <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="btn btn-sm btn-default" onclick="btnDelete_Click"  meta:resourcekey="Delete" />
                        <asp:Button ID="btnApprove" runat="server" Text="Approve" CssClass="btn btn-sm btn-default" onclick="btnApprove_Click"  meta:resourcekey="Approve" />
                        <asp:Button ID="btnDeactivate" runat="server" Text="Deactivate" CssClass="btn btn-sm btn-default" onclick="btnDeactivate_Click"  meta:resourcekey="Deactivate" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
                    
                    <asp:Panel ID="panAdd" runat="server" Visible="false">
                        <div class="well well-sm">
                             <asp:Label ID="Label2" runat="server" Text="New Refund Rule Code:" meta:resourcekey="NewRefundRuleCode"></asp:Label>
                            &nbsp;<asp:TextBox ID="txtRuleCode" runat="server" MaxLength="12" Width="142px"></asp:TextBox>
                            &nbsp;&nbsp;<asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="btn btn-sm btn-default" onclick="btnAdd_Click"  meta:resourcekey="Add" />
                            <br />
                            <asp:Label ID="Label3" runat="server" Text="Note: If the rule code equals 'X', system do not calculate refund money automatically!" meta:resourcekey="NoteIftherulecodeequals" Font-Italic="true"></asp:Label>
                        </div>
                    </asp:Panel>
                    


                    <asp:SqlDataSource ID="sqlRules" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_fare_get_refund_rules" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lstStatus" Name="status" PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </div>
            </div>
        </div>
    </div>

    </div></form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=grdRules.ClientID %>').height()>tab_new_height)
                $('#<%=grdRules.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
